using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace MvcApplication5.Models.Mapping
{
    public class T_UserMap : EntityTypeConfiguration<T_User>
    {
        public T_UserMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Pwd)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.test)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("T_User");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Pwd).HasColumnName("Pwd");
            this.Property(t => t.RoleID).HasColumnName("RoleID");
            this.Property(t => t.IsDel).HasColumnName("IsDel");
            this.Property(t => t.AddTime).HasColumnName("AddTime");
            this.Property(t => t.NewIsDel).HasColumnName("NewIsDel");
            this.Property(t => t.test).HasColumnName("test");
        }
    }
}
